<?php
/**
 * Created by PhpStorm.
 * User: jucai002
 * Date: 2019/1/10
 * Time: 21:21
 */

namespace frontend\controllers;


use yii\web\Controller;

class BaseController extends Controller
{
    public $enableCsrfValidation = false;
    public $layout = false;
    /**
     * @return string
     * 头部
     */
    public function head()
    {
        $data = [
            '首页' => [
                'url' => '/index',
                'upgrading_force' => 'Protal'
            ],
            '关于我' => [
                'url' => '/about',
                'upgrading_force' => 'About'
            ],
            '慢生活' => [
                'url' => '/newlist',
                'upgrading_force' => 'Life'
            ],
            '碎言碎语' => [
                'url' => '/moodlist',
                'upgrading_force' => 'Doing'
            ],
            '模板分享' => [
                'url' => '/share',
                'upgrading_force' => 'Share'
            ],
            '学无止境' => [
                'url' => '/knowledge',
                'upgrading_force' => 'Learn'
            ],
            '留言板' => [
                'url' => 'book.html',
                'upgrading_force' => 'Gustbook'
            ],
        ];

        $html = '';
        foreach ($data as $k => $v) {
            $html .= '<a href="' . $v['url'] . '"><span>' . $k . '</span><span class="en">' . $v['upgrading_force'] . '</span></a>';
        }
        return $html;
    }
}